package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.Storage;
import com.cskaoyan.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("wx/storage")
public class StorageWxController {

    @Autowired
    StorageService storageService;

    @RequestMapping("upload")
    public BaseRespVo upload(MultipartFile file){
        Storage storage = storageService.createStorage(file);
        return BaseRespVo.ok(storage);
    }
}
